package batiment;

import java.util.ArrayList;
import java.util.Collection;

public class BatimentManager {
	
	private static Collection<Batiment> listeBatiments;
	
	public BatimentManager(){
		listeBatiments = new ArrayList<Batiment>();
	}

	public static void add(Batiment batiment) {
		listeBatiments.add(batiment);
	}

	public static Batiment get(String string) throws BatimentIntrouvableException {
		for (Batiment b : listeBatiments){
			if (b.getClass().equals(string))
				return b;
		}
		throw new BatimentIntrouvableException();
	}

}
